#include <stdio.h>

void calSum()
{
	int i;
	int sum = 0;;

	for (i = 1; i <= 10; i++) {
		sum += i;
	}
	printf("sum: %d\n", sum);
}

void calSumMultiple3()
{
	int i;
	int sum = 0;;

	for (i = 1; i <= 10; i++) {
		if (i % 3 == 0) {
			sum += i;
		}
	}
	printf("sum of multiple 3: %d\n", sum);
}

void calSumMultiple3_5()
{
	int i;
	int sum = 0;;

	for (i = 1; i <= 10; i++) {
		if ((i % 3 == 0) || (i % 5 ==0)) {
			sum += i;
		}
	}
	printf("sum of multiple 3 or 5: %d\n", sum);
}

void calSumMultiple3_5_below1000()
{
	int i;
	int sum = 0;;

	for (i = 1; i < 1000; i++) {
		if ((i % 3 == 0) || (i % 5 ==0)) {
			sum += i;
		}
	}
	printf("sum of multiple 3 or 5: %d\n", sum);
}

int main()
{
	calSum();
	calSumMultiple3();
	calSumMultiple3_5();
	calSumMultiple3_5_below1000();
	return 0;
}
